Added default PID values#8895
Conversation
|
This needs to be done in c++ too. |
| m_dPublisher.set(d); | ||
| m_pPublisher.set(1); | ||
| m_iPublisher.set(0); | ||
| m_dPublisher.set(0.01); |
There was a problem hiding this comment.
Leave the setPID method alone, just set the default values in the constructor. DoublePublisher even has a setDefault method.
There was a problem hiding this comment.
So just add below got it
| m_dPublisher.set(d); | ||
| m_pPublisher.set(1); | ||
| m_iPublisher.set(0); | ||
| m_dPublisher.set(0.01); |
There was a problem hiding this comment.
See my comment for PositionConstants.
Update PID coefficients in setPID method.
Update PID coefficients to fixed values.
Updated PID default values and modified setPID method to accept parameters.
There was a problem hiding this comment.
where did the rest of this file go
This class contains feedback and feedforward constants for an ExpansionHub motor, including methods to set PID and feedforward gains.
| .Publish(options); | ||
|
|
||
| // Default PID values | ||
| m_pPublisher.SetDefault(1.0); |
There was a problem hiding this comment.
Don't use SetDefault here, just use Set
| .GetDoubleTopic(fmt::format("/rhsp/{}/motor{}/constants/velocity/kd", | ||
| hubNumber, motorNumber)) | ||
| .Publish(options); | ||
| m_pPublisher.SetDefault(1.0); |
| .publish(options); | ||
|
|
||
| // Default PID values | ||
| m_pPublisher.setDefault(1.0); |
| "/rhsp/" + hubNumber + "/motor" + motorNumber + "/constants/velocity/kd") | ||
| .publish(options); | ||
|
|
||
| m_pPublisher.setDefault(1.0); |
|
You're going to need to undo all the formatting changes made here. Everything was already correctly formatted. |
|
I only need to revert formatting for the cpp, correct? |
|
Java has some bad formatting too. You can set up wpiformat and it will format it for you. Theres instructions in the repo. |
|
I could just do it manually at this point. |
For the specific files, I have added the default PID values, since zach told me to.